'''
Created on Aug 13, 2011

@author: mark
'''

from pickle import dump, load
import tkFileDialog

def create_blank_user():
    user = []
    for x in xrange(15):
        user.append([])
        for y in xrange(15):
            user[x].append('')
    return user

class Game(object):
    '''
    classdocs
    '''


    def __init__(self, user=create_blank_user(), bench=[]):
        '''
        Constructor
        '''
        self.user = user
        self.bench = bench
        
    def save(self, filename):
        with open(filename, 'wb') as f:
            dump(self, f)

'''with open('../game.bin', 'rb') as f:
    game = load(f)'''
    
def load_game():
    file = tkFileDialog.askopenfile('rb')
    if file:
        game = load(file)
        return game
    return None